function precision_calculator(fid,table)

true_pos    = table(1, 1);
false_neg   = table(1, 2);
false_pos   = table(2, 1);
true_neg    = table(2,2);
total       = sum(table(:));

accuracy    = sum(diag(table)) / total;
fprintf(fid,'Accuracy\n');
fprintf(fid,'%0.2f\n', accuracy * 100);

sensitivity = true_pos / sum(table(:, 1));
fprintf(fid,'Sensitivity\n');
fprintf(fid,'%0.2f\n', sensitivity * 100);

specificity = true_neg / sum(table(:, 2));
fprintf(fid,'Specificity\n');
fprintf(fid,'%0.2f\n', specificity * 100);

mean        = sqrt(sensitivity * specificity);
fprintf(fid,'Geometric mean of sensitivity and specificity\n');
fprintf(fid,'%0.2f\n', mean * 100);

precision   = true_pos / sum(table(1, :));
fprintf(fid,'Precision\n');
fprintf(fid,'%0.2f\n', precision * 100);

fmeasure     = 2 * true_pos / (2 * true_pos + false_pos + false_neg);
fprintf(fid,'F-Measure\n');
fprintf(fid,'%0.2f\n', fmeasure * 100);

end